package com.zatech.cgnci.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zatech.cgnci.project.base.utils.ConvertUtils;
import com.zatech.cgnci.project.entity.CgnciClaimBasisDO;
import com.zatech.cgnci.project.mapper.CgnciClaimBasisMapper;
import com.zatech.cgnci.project.service.CgnciClaimBasisService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zatech.cgnci.project.vo.CgnciClaimBasisVO;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 理赔基础表 服务实现类
 * </p>
 *
 * @author Generator
 * @since 2024-12-17
 */
@Service
public class CgnciClaimBasisServiceImpl extends ServiceImpl<CgnciClaimBasisMapper, CgnciClaimBasisDO> implements CgnciClaimBasisService {

    @Override
    public List<CgnciClaimBasisVO> listClaimBasisByInsuranceId(Long insuranceId) {
        List<CgnciClaimBasisDO> claimBasisList = this.list(new LambdaQueryWrapper<CgnciClaimBasisDO>().eq(CgnciClaimBasisDO::getBusinessId, insuranceId));
        return ConvertUtils.convert(claimBasisList, CgnciClaimBasisVO.class);
    }
}
